<include file="__THEME__/header" />
<link href="__APP__/team.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="__APP__/team.js"></script>
<!-- <script type="text/javascript" src="__THEME__/js/module.form.js"></script> -->
<script>
var changelock = 0;
function changeteam(obj){
	if ( changelock == 1 ){
		return;
	}
	changelock = 1;
	var teamid = $(obj).val();
	if (teamid==0){
		return;
	}
	var teamname = $(obj).children('option[selected="selected"]').text();
	$('#teaminfo').text('');
	$.post(U('team/Index/checkTeamStatus'),{teamid:teamid},function (res){
		if(res==1){
			//ui.error('"'+teamname+'"，需要关注后才能发表帖子');
			$('#teaminfo').text('提示："'+teamname+'"，需要关注后才能发表帖子');
		}else if(res==2){
			//ui.error('"'+teamname+'"，需要管理员才能发表帖子');
			$('#teaminfo').text('提示："'+teamname+'"，需要管理员才能发表帖子');
		}else if(res==3){
			$('#teaminfo').text('提示："'+teamname+'"，需要队内才能发表帖子');
		}
		changelock = 0;
	});
}
</script>
<div id="page-wrap">
  <div id="main-wrap">
    <div class="st-bg">
      <!-- <p class="team-location"><a href="{:U('team/Index/index')}">队伍</a>&nbsp;>&nbsp;发表新帖</p> -->
      <div class="team-box"> 
        <!-- <h3>发新贴</h3> -->
        <form method="post" action="{:U('team/Index/doPost')}" model-node='team_post' onsubmit="return setcontent();" name="teamPost">
          <dl class="form-set">
            <dd>
              <div class="form-tt"><font color="red"> * </font>选择队伍</div>
              <div class="form-row">
                <div class="select-area"><a id="team_name" name="1" href="javascript:void(0);">请选择队伍<i class="ico-arrow-down right mt15"></i></a>
                  <input id="team_id" type="hidden" value="" name="team_id" /></div>
                <div class="kind-list kind-1" id="kind-1" style="width:700px; border-bottom:#E2DDD5 1px solid; border-top:none;">
                  <ul class="clearfix">
                    <php>foreach( $list as $v ){</php>
                    <li id="team_id_{$v.team_id}" onclick="teamName({$v.team_id})">{$v['team_name']|getShort=8}</li>
                    <php>}</php>
                  </ul>
                </div>
              </div>
            </dd>
            <dd>
              <div class="form-tt"><font color="red"> * </font>标题</div>
              <div class="form-row">
                <input class="text" type="text" name="title" id="title" style="width:690px;" onkeydown="if(event.keyCode==13){return false;}">
              </div>
            </dd>
            <dd>
              <div class="form-tt"><font color="red"> * </font>正文</div>
              <div class="form-row" style="line-height:normal;">{:W('UM', array('type'=>'team','contentName'=>'content','content'=>'','width'=>'700','tpl'=>'team'))}</div>
            </dd>
            <dd>
              <div class="form-tt">附件</div>
              <div class="form-row">{:W('Upload', array('urlquery'=>'attach_type=team_attach'))}
                <span style="font-size:12px; color:#888;">文件大小不能超过{$attach_update_config.attach_max_size}M，且只允许上传格式：{$attach_update_config.attach_allow_extension}</span>
              </div>
            </dd>
            <dd>
              <div class="form-tt"></div>
              <div class="form-row"> <a href="javascript:;" class="btn_b mr5 btn-green-big" event-node="submit_btn" event-args="editor=true"><span>确定</span></a> <a href="{:U('team/Index/index')}" class="btn_w"><span>取消</span></a> </div>
            </dd>
          </dl>
        </form>
      </div>
    </div>
  </div>
</div>
<script>
//分类标签选择	
	$("#team_name").click(function(){
			$(".kind-list").toggle();
		})
//如果没有可选择队伍，添加提示
function nocircleTip(obj,tips){
	var tipContent = ''+'<p class="f8 p20">您没有可选择的队伍，<a href="{:U('team/Index/teamList',array('type'=>$_GET['type']))}"class="f-red">赶紧去加入吧！</a></p>'
	if($(obj).length<1){
		$(tips).html(tipContent);
		}
}
nocircleTip("#kind-1 li","#kind-1");
	
function teamName(team_id){
  		var data = $('#team_id_'+team_id).text()+"<i class='ico-arrow-down right mt15'></i>";
  		$('#team_id').val(team_id);
		$(".kind-list").hide();
  		$('#team_name').html(data);
};</script> 
<include file="__THEME__/public_footer" /> 
